/**
 * Created by sunlei on 2015/8/28.
 */

TimerTask task=new TimerTask() {

    @Override
    void run() {
        println "tick tick..."+System.currentTimeMillis()
    }
}

Timer timer=new Timer()
timer.schedule(task,0,1000)

Thread.sleep(10000)